package cloud.common.redis.redis.service.impl;

import cloud.common.redis.redis.service.IRedisHashService;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.stereotype.Service;

/**
 * @author czq
 */
@Service
public class RedisHashServiceImpl extends RedisServiceImpl implements IRedisHashService {

    @Override
    public void setHashValue(String key, String hashKey, String value) {
        HashOperations<String,String,String> opsForHash = redisTemplate.opsForHash();
        opsForHash.put(key,hashKey,value);
    }

    @Override
    public String getHashValue(String key, String hashKey) {
        HashOperations<String,String,String> opsForHash = redisTemplate.opsForHash();
        return opsForHash.get(key,hashKey);
    }
}
